!(function (win, doc) {
  function ss() {
    var size = (window.innerWidth / 750) * 100;
    doc.documentElement.style.fontSize = (size < 100 ? size : 100) + 'px';
  }
  var evt = 'resize';
  var timer = null;
  win.addEventListener(evt, function () {
    clearTimeout(timer);
    timer = setTimeout(ss, 300);
  }, false);
  win.addEventListener("pageshow", function (e) {
    if (e.persisted) {
      clearTimeout(timer);
      timer = setTimeout(ss, 300);
    }
  }, false);
  ss();

}(window, document));
(function () {
  if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
    handleFontSize();
  } else {
    if (document.addEventListener) {
      document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
    } else if (document.attachEvent) {
      document.attachEvent("WeixinJSBridgeReady", handleFontSize);
      document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
    }
  }
  function handleFontSize() {
    WeixinJSBridge.invoke('setFontSizeCallback', {
      'fontSize': 0
    });
    WeixinJSBridge.on('menu:setfont', function () {
      WeixinJSBridge.invoke('setFontSizeCallback', {
        'fontSize': 0
      });
    });
  }
})();